package com.yuhang.demo.exceptionHandler;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author yyh
 * @create 2021-05-10 13:43
 */

@Data
@AllArgsConstructor  //生成有参数构造方法
@NoArgsConstructor   //生成无参数构造
public class MyException extends RuntimeException {

    @ApiModelProperty(value = "状态码")
    private Integer code;


    @ApiModelProperty(value = "异常信息")
    private String msg;

    @Override
    public String toString() {
        return "MyException{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                '}';
    }
}

